package com.jdbc;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * Created by
 *  连接数据库的service
 * @author touni
 * @date 2019/4/8
 * @time 14:59
 */
@Service
public class JDBCService {


    @Autowired
    private JdbcTemplate jdbcTemplate;


    public Object queryDatebase(Long custId) {

        List<Map<String, Object>> maps = jdbcTemplate.queryForList("select * from customer where cust_id=22");
        return maps;


    }
}
